package cn.edu.lingnan.fruitshop.service.impl;

import cn.edu.lingnan.fruitshop.pojo.Goodstype;
import cn.edu.lingnan.fruitshop.mapper.GoodstypeMapper;
import cn.edu.lingnan.fruitshop.service.GoodstypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张小凡
 * @since 2022-01-04
 */
@Service
public class GoodstypeServiceImpl extends ServiceImpl<GoodstypeMapper, Goodstype> implements GoodstypeService {

    @Autowired(required = false)
    private GoodstypeMapper goodstypeMapper;

    //点击跳转到添加商品界面，并显示商品类型
    @Override
    public String toAddGoods(Model model) {
        List<Goodstype> goodstypes = goodstypeMapper.selectList(null);
        model.addAttribute("goodTypes",goodstypes);
        return "user/seller_center_add";
    }
}
